package com.coolingme.algo_01_list.addtwolist;


/**
 * 链表
 *
 * @author wangyue
 * @date 2020/11/5 15:13
 */
public class ListNode {

    public Integer value;

    public ListNode next;

    public ListNode(Integer value) {
        this.value = value;
    }

    public ListNode setNext(Integer value) {
        this.next = new ListNode(value);
        return next;
    }

    @Override
    public String toString() {
        String result = this.value.toString();
        if (this.next != null) {
            result += " => " + this.next.toString();
        }
        return result;
    }

}
